package com.cupk.dtos;

import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 成果响应DTO
 */
@Data
public class PublicationDto {
    private Long id;
    private String title;
    private String type; // JOURNAL, CONFERENCE, PATENT, SOFTWARE, BOOK, OTHER
    private String status; // DRAFT, SUBMITTED, UNDER_REVIEW, ACCEPTED, PUBLISHED, REJECTED
    private String authors;
    private String journal;
    private String abstractText;
    private String keywords;
    private LocalDate publishDate;
    private String doi;
    private String url;
    private BigDecimal impactFactor;
    private Integer citationCount;
    private Long projectId;
    private String projectName;
    private Long userId;
    private String userName;
    private String documentUrl;
    private String documentName;
    private List<String> attachments;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
    
    // 兼容性字段
    private String journalConferenceName;
    private Integer publicationYear;
    private String doiLink;
    private Long uploaderId;
    
    // 兼容性方法
    public String getJournalConferenceName() {
        return this.journal;
    }
    
    public Integer getPublicationYear() {
        return this.publishDate != null ? this.publishDate.getYear() : null;
    }
    
    public String getDoiLink() {
        return this.doi;
    }
    
    public Long getUploaderId() {
        return this.userId;
    }
}
